Skip to content

Conversation

@bladyjoker
Copy link

@bladyjoker bladyjoker commented Dec 4, 2025

Relates to #636

A small as possible set of changes that introduces modular configurations via build.nix files (opt in) and a repo wide set of source checks that can be ran with nix fmt command.

That's my take on the current Nix best practices that I found to be empowering even to the Nix uninitiated.

DONE

  • Enable flake-parts based Nix layout using "build.nix" files
  • pre-commit hooks using git-hooks.nix
    • Enable Nix checkers
    • Enable Haskell checkers (fourmolu 0.19.0.1, HLint v3.10)
    • Enable Markdown checkers
      • Tried but too many hits, perhaps it makes sense to gradually introduce with an allow list
    • Enable Rust checkers (clippy, rustfmt)
      • Too invasive and too many errors
    • Enable Python checkers (black, ruff)
    • Enable Shell checkers (shellcheck)
      • Great tool, but needs further config to ignore many generated shell scripts

BREAKING

  • .github/workflows/simulation.yaml was using Fourmolu 0.15 I updated it to newer Fourmolu 0.19.0.1
  • hydraJobs have been transposed, instead of hydraJobs.${system}.packages.foo now it hydraJobs.packages.foo.${system}

INSPECT

$ nix repl
Welcome to Nix 2.18.8. Type :? for help.

nix-repl> :lf .
Added 27 variables.

nix-repl> devShells.x86_64-linux.<TAB>
devShells.x86_64-linux.default        devShells.x86_64-linux.dev-top-level  devShells.x86_64-linux.web

nix-repl> checks.x86_64-linux.    
checks.x86_64-linux.ols-test             checks.x86_64-linux.pre-commit           checks.x86_64-linux.test-trace-verifier

nix-repl> packages.x86_64-linux.<TAB>
packages.x86_64-linux.agdaIOGPrelude               packages.x86_64-linux.agdaTraceParser              packages.x86_64-linux.linear-leios-trace-verifier  packages.x86_64-linux.short-leios-trace-verifier
packages.x86_64-linux.agdaLeiosSpec                packages.x86_64-linux.agdaWithDeps                 packages.x86_64-linux.networkSpec                  packages.x86_64-linux.simRealism
packages.x86_64-linux.agdaSets                     packages.x86_64-linux.combined-haddock             packages.x86_64-linux.ols                          packages.x86_64-linux.test-trace-verifier
packages.x86_64-linux.agdaStdlib                   packages.x86_64-linux.hsTraceParser                packages.x86_64-linux.ols-test
packages.x86_64-linux.agdaStdlibClasses            packages.x86_64-linux.leios-trace-processor        packages.x86_64-linux.pre-commit-check
packages.x86_64-linux.agdaStdlibMeta               packages.x86_64-linux.leiosDesignPdf               packages.x86_64-linux.read-the-docs-site

nix-repl> hydraJobs.<TAB>
hydraJobs.checks     hydraJobs.devShells  hydraJobs.packages

@bladyjoker bladyjoker marked this pull request as draft December 4, 2025 19:04
@bladyjoker bladyjoker self-assigned this Dec 4, 2025
@bladyjoker bladyjoker mentioned this pull request Dec 5, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants